<?php include __DIR__.'/../public/header_m.php';?>
<div class="container mw-700px">
  <div id="titlebar">
    <div class="heading">
      <span class="prefix"><i class="icon-user"></i></span>
      <strong><small class="text-muted"><i class="icon-plus"></i></small> 添加功能</strong>
    </div>
  </div>
  <form id="dataform" target="hiddenwin" method="post" action="<?php echo $formUrl; ?>" class="form-condensed mw-700px">
    <?php if(isset($id)): ?>
        <input name="data[id]" type="hidden" value="<?php echo $id;?>" />
    <?php endif; ?>
    <table align="center" class="table table-form"> 
      <tbody>
      <tr>
        <th>功能名</th>
        <td><div class="required required-wrapper"></div><input type="text" autocomplete="off" class="form-control" value="<?php if(isset($permissionInfo['name'])) echo $permissionInfo['name']; ?>" id="name" name="data[name]" placeholder="中文吧，方便记忆">
        </td>
      </tr>
      <tr>
        <th>模块名</th>
        <td><div class="required required-wrapper"></div><input type="text" autocomplete="off" class="form-control" value="<?php if(isset($permissionInfo['module'])) echo $permissionInfo['module']; ?>" id="module" name="data[module]" placeholder="如果做为顶级菜单，这里随便写吧">
        </td>
      </tr>
      <tr>
        <th>类名</th>
        <td><div class="required required-wrapper"></div><input type="text" autocomplete="off" class="form-control" value="<?php if(isset($permissionInfo['class'])) echo $permissionInfo['class']; ?>" id="class" name="data[class]" placeholder="同上">
        </td>
      </tr>
      <tr>
        <th>函数名</th>
        <td><div class="required required-wrapper"></div><input type="text" autocomplete="off" class="form-control" value="<?php if(isset($permissionInfo['action'])) echo $permissionInfo['action']; ?>" id="action" name="data[action]" placeholder="同上">
        </td>
      </tr>
      <tr>
        <th>父级功能</th>
        <td>
            <div class="required required-wrapper"></div>
            <select class="form-control" id="pid" name="data[pid]">
                <option value="0">请选择父级功能</option>
                <?php echo $select;?>
            </select>
        </td>
        <td width="150"></td>
      </tr>
      
      <tr>
        <th>备注</th>
        <td>
          <textarea style="height:100px;" type="text" class="form-control" id="mark" name="data[mark]" ><?php if(isset($permissionInfo['mark'])) echo $permissionInfo['mark']; ?></textarea>
        </td>
      </tr>
      
      <tr>
        <th>是否显示菜单</th>
        <td>
          <label class="radio-inline"><input type="radio" id="genderm" <?php if(isset($permissionInfo['display']) && $permissionInfo['display'] == 1) echo 'checked="checked"'; ?> value="1" name="data[display]"> 是</label>
          <label class="radio-inline"><input type="radio" id="genderf" <?php if(isset($permissionInfo['display']) && $permissionInfo['display'] == 0) echo 'checked="checked"'; ?> value="0" name="data[display]"> 否</label></td>
      </tr>

      <tr><th></th><td> <button class="btn btn-submit btn-primary" id="submit" data-submitting="提交中..." type="submit">保存</button><a class="btn btn-back" href="javascript:history.go(-1);">返回</a></td></tr>
    </tbody></table>
  </form>
</div>
<?php include __DIR__.'/../public/footer_m.php';?>